<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>资源库-ylbnotesHub</title>
    <link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <link rel="stylesheet" th:href="@{/css/mycss.css}">
    <link rel="stylesheet" th:href="@{/zplayer/css/zplayer.min.css}">
    <script th:src="@{/zplayer/js/zplayer.min.js}"></script>
    <link rel="stylesheet" href="//at.alicdn.com/t/font_2080705_x7u3h1yrrfc.css">
</head>
<body>

<div th:replace="~{common/header::header(activeUrl='download')}"></div>

<div class="container">

    <div class="row">
        <div class="col-md-2">
            <div th:replace="~{index::bar}"></div>
        </div>
        <div class="col-md-8">

            <br>
            <hr class="layui-bg-blue">

            <div th:fragment="download">


                <main role="main" class="mt-3">
                    <div class="container">
                        <div class="alert" role="alert">
                            <strong>资源内库</strong>
                        </div>

                    </div>
                </main>

                <div class="card mb-4 shadow-sm" th:if="${downloadList.size()==0}">
                    <div class="media text-muted pt-3">暂时没有资源~ &emsp;&emsp;
                    </div>
                </div>
                <div class="card mb-4 shadow-sm">
                    <div class="layui-collapse" th:each="download:${downloadList}">
                        <div class="layui-colla-item">
                            <h2 class="layui-colla-title" th:text="${download.getDname()}"></h2>
                            <div class="layui-colla-content">
                                <h5 th:text="${download.getDdesc()}"></h5>
                                <p onclick="copy(this)" th:text="${download.getDcode()}" style="color: #000000;" class="layui-btn layui-btn-primary"
                                ></p>
                                <input type="text" th:value="${download.getDcode()}" style="position:absolute;left: 0; z-index: -1;">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <hr class="layui-bg-blue">

    <div th:replace="common/musicPlayer::musicPlayer"></div>
</div>


<div th:replace="~{common/footer::footer}"></div>

<a class="to-top"><i class="iconfont icon-fanhuidingbu1" style="font-size:50px;color: #007bff"></i></a>
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
<script th:src="@{/js/toTop.js}"></script>
<script th:src="@{/layui/layui.all.js}"></script>

<script>
    //注意：折叠面板 依赖 element 模块，否则无法进行功能性操作
    layui.use('element', function(){
        var element = layui.element;

    });

    // 点击复制
    function copy(ths) {
        // 获取同级下一个元素
        var inp = ths.nextSibling.nextSibling;
        inp.select();
        document.execCommand("Copy");

        layui.use('layer', function(){
            var layer = layui.layer;
            layer.msg('复制成功',{offset:'10%'});
        });
    }
</script>
</body>
</html>